package com.wuhan.template.module.zixun.fragment;

import android.graphics.Color;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;

import com.wuhan.template.R;
import com.wuhan.template.base.BaseFragment;
import com.wuhan.template.module.zixun.adapter.ZixunFragPagerAdapter;

import butterknife.BindView;

/**
 * Created by Administrator on 2016/5/16.
 */
public class ZixunFragment extends BaseFragment {

    @BindView(R.id.zx_tab)
    TabLayout tab;
    @BindView(R.id.zx_vp)
    ViewPager vp;

    @Override
    protected int getLayoutId() {
        return R.layout.frag_zixun_layout;
    }

    @Override
    protected void initViews() {
        tab.setTabMode(TabLayout.MODE_SCROLLABLE);
        tab.setSelectedTabIndicatorColor(Color.parseColor("#006EBF"));
        ZixunFragPagerAdapter adapter = new ZixunFragPagerAdapter(getActivity().getSupportFragmentManager());
        vp.setAdapter(adapter);
        tab.setupWithViewPager(vp);
    }
}
